package com.chenyongjing.design.pattern.flyweight.jdkString;

public class IntegerTest {
    public static void main(String[] args) {
        Integer a= Integer.valueOf(100);
        Integer b= 100;
        System.out.println( a==b);//自动拆箱和装箱,这里用到享元模式

        Integer c = Integer.valueOf(1000);
        Integer d =10000;
        System.out.println(c==d);

        Integer e = Integer.valueOf(128);
        Integer f =128;
        System.out.println(e==f);

        /**
         * Integer在-128到127使用共享模式
         */
        Integer g = Integer.valueOf(127);
        Integer h =127;
        System.out.println(g==h);

        Long l=Long.valueOf(127);


    }
}
